<template>
  <div>
    <Header :isLogin="isLogin" :newMsg="newMsg" />
    <personal />
    <Footer />
  </div>
</template>

<script>
import Header from "../../../header/header";
import personal from "../personal-center/personal-center";
import Footer from "../../../footer/footer";
import axios from "../../../../api/axios";
export default {
  components: {
    Header,
    personal,
    Footer
  },
  data() {
    return {
      isLogin: false,
      newMsg: false
    };
  },
  mounted() {
    axios.get("/user/info").then(resp => {
      if (resp.code != 0) {
        this.$router.push("/");
      } else {
        this.EventBus.$emit("isLogin", true, resp.data.newMsg,resp.data.role);
      }
    });
  }
};
</script>

<style scoped>
a {
  display: block;
  height: 100%;
}
</style>
